<template>
<view>
	<view class="list" v-for="(item,index) in list" :key="index" @click="jump(item.uid)">
		<view class="left">
			<image :src="item.avatar"></image>
		</view>
		<view class="right">
			<view class="right_top">
				<view class="name">{{item.realname}}</view>
				<view class="time">{{item.addtime}}</view>
			</view>
			<view class="item">{{item.sex}} / {{item.age}}岁 / {{item.education}} / {{item.workType}}</view>
			<view class="item">意向职位:{{item.post}}</view>
		</view>
	</view>
</view>
</template>
<script>
import request from '@/util/request.js'
export default {
	data() {
		return{
			list:[],
			page:1,
			pageShow:true
		}
	},
	onLoad:function(){
		uni.showLoading({
		    title: '加载中'  
		});
		this.getlist();
	},
	methods: {
		getlist:function(){
			var that = this;
			var data = {
				uid:uni.getStorageSync('uid'),
				page:this.page
			}
			request({
				url: 'company/matchJob',
				method: 'get',
				data:data,
				success: (res) => {
					console.log(res)
					uni.hideLoading();
					if(res.data.code == 1){
						if(res.data.data.last_page <= that.page){
							that.pageShow = false
						}
						if(that.page == 1){
							that.list = res.data.data.data
						}else{
							var list = that.list
							that.list = list.concat(res.data.data.data)
						}
					}
				}
			})
		},
		onReachBottom: function(){
			if(this.pageShow){
				 //当前不是最后一页可加载
				 this.page = this.page + 1
				 uni.showLoading()
				 this.getlist();
			}
		},
		jump:function(uid){
			var url = "/pages/job/info?uid="+uid
			uni.navigateTo({
				url:url
			});
		}
	}
}
</script>
<style>
.list{
	display: flex;
	flex-direction: row;
	padding:15rpx 15rpx 15rpx 15rpx;
	border-bottom: 5rpx solid #CCCCCC;
}
.left{
	width:30%;
	text-align: center;
}
.left image{
	width:180rpx;
	height:180rpx;
	border-radius: 50%;
}
.right{
	width:70%;
	padding:15rpx 15rpx 15rpx 15rpx;
	display: flex;
	flex-direction: column;
}
.right_top{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	padding-top:5rpx;
}
.name{
	font-weight: bold;
	font-size:15px;
}
.time{
	font-size: 13px;
	color:#ff1a1a;
}
.item{
	width:100%;
	margin-top:15rpx;
}
</style>